<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
     template="TemplateFrontEnd.xhtml">
<ui:define name="title">Information offre</ui:define>
<ui:define name="body" >

<script>



function paiement()
{
	//alert(document.getElementById("j_idt20:paiment").value);
	
	if(document.getElementById("j_idt20:paiment").value=="hii")
		{
		
		document.getElementById("j_idt20:pay").style.display="block";
		}
	else
		{
		document.getElementById("j_idt20:pay").style.display="none";
		}
	
		
}



</script>
<h:form>

<p:inputText id="paiment" value="#{infoOffreMB.paiement}" />
<p:panelGrid columns="1" style="width:100%;" >
<p:panelGrid columns="2"  >
<p:outputLabel value="Item Title:"/>
<p:outputLabel value="#{infoOffreMB.offre.titre}"/>

<p:outputLabel value="Expiring Date and Time:"/>
<p:outputLabel value="#{infoOffreMB.offre.date_Expiration}"/>

</p:panelGrid>
<p:panelGrid columns="1" style="width:49%;" >
<p:outputLabel value="Shipment Map and Route:"/>

<p:inputText value="#{infoOffreMB.idOffre}"  />

    <p:gmap  id="gmap" center="36.890257,30.707417" zoom="13" type="HYBRID" model="#{infoOffreMB.advancedModel}" style="width:100%;height:400px">
 
        <p:ajax event="overlaySelect" listener="#{infoOffreMB.onMarkerSelect}" />
        <p:gmapInfoWindow id="infoWindow">
            <p:outputPanel style="text-align: center; display: block; margin: auto">
 
                    <p:graphicImage name="/demo/images/antalya/#{infoOffreMB.marker.data}" height="150" />
                    <br />
                    <h:outputText value="#{infoOffreMB.marker.title}" />
 
            </p:outputPanel>
        </p:gmapInfoWindow>
    </p:gmap>

    <!-- Preload for demo -->
    <p:outputPanel style="display:none">
        <p:graphicImage name="/demo/images/antalya/konyaalti.png" />
        <p:graphicImage name="/demo/images/antalya/ataturkparki.png" />
        <p:graphicImage name="/demo/images/antalya/kaleici.png" />
        <p:graphicImage name="/demo/images/antalya/karaalioglu.png" />
    </p:outputPanel>
    

<p:panelGrid columns="2">
<p:outputLabel value="Loading Place" />
<p:outputLabel value="Offloading Place" />
<p:panelGrid columns="2">
 <p:graphicImage value="../images/Map/blue-dot.png" />
 <p:outputLabel value="#{infoOffreMB.offre.villeDepart.etat.pays.intitule},#{infoOffreMB.offre.villeDepart.etat.intitule},#{infoOffreMB.offre.villeDepart.intitule}" />
 </p:panelGrid>
 <p:panelGrid columns="2">
 <p:graphicImage value="../images/Map/icone-rouge1.png" style="width:22px;heigth:22px" />
 <p:outputLabel value="#{infoOffreMB.offre.villeArrive.etat.pays.intitule},#{infoOffreMB.offre.villeArrive.etat.intitule},#{infoOffreMB.offre.villeArrive.intitule}" />
 </p:panelGrid>
 </p:panelGrid>
 
 <p:panelGrid columns="2">
 <p:outputLabel value="Desired Price" />
 <p:outputLabel value="#{infoOffreMB.offre.prix_desire} $" />
 <p:outputLabel value="Minimum Bid Reduction" />
 <p:outputLabel value="200 $" />
 </p:panelGrid>
 <p:commandButton oncomplete="paiement()" update="paiment"   value="Make your Bid"   actionListener="#{infoOffreMB.MakeABid()}" />
   

 <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
 
 <p:commandButton id="pay" style="display:none;" ajax="false"  value="pay" action="#{infoOffreMB.pay()}"  />
<p:outputLabel value="Leading Bid:" />

<p:dataTable>
<p:column headerText="Bidder CID">
	
</p:column>
<p:column headerText="Bid Date   Time">
</p:column>
<p:column headerText="Bid Amount">
</p:column>
</p:dataTable>
<p:outputLabel value="Auction Bid History:" />

<p:dataTable>
<p:column headerText="Bidder CID">
	
</p:column>
<p:column headerText="Bid Date   Time">
</p:column>
<p:column headerText="Bid Amount">
</p:column>
</p:dataTable>

</p:panelGrid>

</p:panelGrid>

<p:panelGrid columns="2">
<p:outputLabel value="Questions for this Job" />
<p:commandLink value="Ask a Question" />
<p:commandButton value="Sign in to Place Bid" />

<p:commandButton value="Join Us and Place Bid" action="RegisterPriCarrier.xhtml" />
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>